﻿@namespace BootstrapBlazor.Components
@inherits ModalDialogBase

<div class="@ClassName" role="document" @ref="DialogElement">
    <div class="modal-content">
        <div class="modal-header">
            <h5 class="modal-title">@Title</h5>
            <button type="button" class="close" data-dismiss="modal" aria-label="Close" @onclick="@OnClose">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
        <CascadingValue Name="BodyContext" Value="@BodyContext" IsFixed="true">
            <div class="modal-body">
                @BodyTemplate
            </div>
            @if (ShowFooter)
            {
                <div class="modal-footer">
                    @if (ShowCloseButton)
                    {
                        <button type="button" class="btn btn-secondary" data-dismiss="modal" @onclick="@OnClose">
                            <i class="fa fa-times"></i>
                            <span>关闭</span>
                        </button>
                    }
                    @FooterTemplate
                </div>
            }
        </CascadingValue>
    </div>
</div>
